// JavaScript Document

/* -----------------------------------------------
   Floating layer - v.1
   (c) 2006 www.haan.net
   contact: jeroen@haan.net
   You may use this script but please leave the credits on top intact.
   Please inform us of any improvements made.
   When usefull we will add your credits.
  ------------------------------------------------ */

var x = 20;
var y = 70;
var HeadRPI;

function setHead(obj) {
	obj = document.getElementById(obj);
	HeadRPI = obj.innerHTML;
}
//Purpose: Display the Selected Event with details
//Inputs: ID of the Div to Display
function setVisibleRPI(obj)
{
	//Find the Div to Display
	obj = document.getElementById(obj);
	
	//Fill the Div with the Selected Event
	obj.innerHTML = HeadRPI + '<h4>' +
	events.bwEventList.events[currentRPI - 1].summary + '</h4><p>' + 
	'Start: ' + events.bwEventList.events[currentRPI - 1].start.dayname + ', ' + events.bwEventList.events[currentRPI - 1].start.longdate + 
	' at ' + events.bwEventList.events[currentRPI - 1].start.time + '<br />' + 
	'End: ' + events.bwEventList.events[currentRPI - 1].end.dayname + ', ' + events.bwEventList.events[currentRPI - 1].end.longdate + 
	' at ' + events.bwEventList.events[currentRPI - 1].end.time + '<br /><br />' + 
	'Location: ' + events.bwEventList.events[currentRPI - 1].location.address + '</p><p>' +
	'Category: ' + events.bwEventList.events[currentRPI - 1].categories[0] + '</p><p>' +
	'Description: ' + events.bwEventList.events[currentRPI - 1].description + '</p><p>' +
	events.bwEventList.events[currentRPI - 1].eventlink + '</p>';
	
	//Set the Div to "visible"
	obj.style.visibility = (obj.style.visibility == 'visible') ? 'hidden' : 'visible';
}
function placeIt(obj)
{
	obj = document.getElementById(obj);
	if (document.documentElement)
	{
		theLeft = document.documentElement.scrollLeft;
		theTop = document.documentElement.scrollTop;
	}
	else if (document.body)
	{
		theLeft = document.body.scrollLeft;
		theTop = document.body.scrollTop;
	}
	theLeft += x;
	theTop += y;
	obj.style.left = theLeft + 'px' ;
	obj.style.top = theTop + 'px' ;
	setTimeout("placeIt('description')",500);
}
window.onscroll = setTimeout("placeIt('description')",500);
